
var pagindex=0;
var  pagesize=10;
var str = "";
function  getadlist() {
    showLoading("正在加载..","div");
    mui.post('/Article/findAll',{ pageindex:pagindex,
            pagesize:pagesize}, function (data) {
            console.log(data);

            if (data.code && data.object.length > 0) {
                var x = document.getElementById("adlist");
                for (var i in data.object) {
                    var item = data.object[i];
                    str += '<li class="mui-table-view-cell mui-media" id="';
                    str += item.id;
                    str += '">';
                    str += '<a class="mui-navigate-right"  href="fenxaddetails.html?id=';
                    str += item.id;
                    str += '">';
                    str += '<img class="mui-media-object mui-pull-left"';
                    str += ' src="'
                    str +=imgsrcpath()+ item.preimage;
                    str += '">';
                    str += '<div class="mui-media-body">';
                    str += item.title;
                    str += '<p class="mui-ellipsis">';
                    str += item.pretext;
                    str += '</p>';
                    str += '</div>';
                    str += '</a>';
                    str += '</li>';
                }
                x.innerHTML = str;//改变内容
            }
            if (data.object.length%10!=0 )
            {
                $("#loding").hide();//表示display:none;
                var x = document.getElementById("loding");
                x.innerHTML = "没有了..";//改变内容
            }
            else {

                $("#loding").show();//表示display:none;
                var x = document.getElementById("loding");
                x.innerHTML = "点击加载更多..";//改变内容
                pagindex= pagindex+10;
            }
            hideLoading();//隐藏后的回调函数
        }, 'json'
    )
}
$(function(){
    getadlist();
});
















